package com.soboot.system.feign.factory;

import com.soboot.system.feign.UserInfoFeignClient;
import com.soboot.system.feign.fallback.UserInfoFeignFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author:
 * @createTime: 2022年09月21日 10:08:54
 * @version:
 * @Description:
 * @Copyright:
 */
@Component
public class UserInfoFeignFactory implements FallbackFactory<UserInfoFeignClient> {

    @Override
    public UserInfoFeignClient create(Throwable throwable) {

        UserInfoFeignFallback fallback = new UserInfoFeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
